#define _CRT_SECURE_NO_WARNINGS 1 
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
using namespace std;

string toLower(const string& str)
{
    string ret;
    for (char c : str)
    {
        if (c >= 'A' && c <= 'Z')
        {
            ret += c + 'a' - 'A';
        }
        else {
            ret += c;
        }
    }

    return ret;
}

vector<string> spilt(const string& str)
{
    auto start = str.begin();
    auto end = str.begin();
    vector<string> ret;
    while (end != str.end())
    {
        cout << *end << " ";
        if ((*end >= 'A' && *end <= 'Z') || (*end >= 'a' && *end <= 'z'))
        {
            end++;
        }
        else {
            ret.push_back(toLower(string(start, end)));
            start = ++end;
        }
    }
    return ret;
}

struct Greater {
    bool operator()(pair<string, int>& kv1, pair<string, int>& kv2)
    {
        return (kv1.second > kv2.second) || (kv1.second == kv2.second &&
            kv1.first < kv2.first);
    }
};

int main() {
    string str;
    getline(cin,str);

    vector<string> words = spilt(str);

    /*
    map<string,int> countMap;
    for(const auto& e : words)
    {
        countMap[e]++;
    }

    vector<pair<string,int>> countVec(countMap.begin(),countMap.end());
    sort(countVec.begin(),countVec.end(),Greater());

    for(const auto& e : countVec)
    {
        cout<<e.first<<":"<<e.second<<endl;
    }
    */
    return 0;

}
